import com.gitee.ec.EverythingClient;
import com.gitee.ec.common.EverythingUtils;
import com.gitee.ec.common.FileInfo;
import com.gitee.ec.common.SortBy;
import com.gitee.ec.kernel.SearchCondition;

import java.util.List;

/**
 * @author hongda.li
 */
public class EverythingClientMain {
    public static void main(String[] args) {
        EverythingClient clientV4 = EverythingUtils.getClient();
        System.out.println(clientV4.version());

        System.out.println(clientV4.count(new SearchCondition().setExpression("test")));

        List<FileInfo> infos = clientV4.search(new SearchCondition()
                .setExpression("dm8_20230106_x86_win_64")
                .setSortBy(SortBy.EVERYTHING_SORT_NAME_DESCENDING));
        for (FileInfo info : infos) {
            System.out.println(info);
        }
    }
}
